package edu.sdust.ssmstudy.json.base;

/**
 * Created by pengcai
 * Date:2017/7/27.
 * Time:11:23:59
 */
public class Sort {

    /**
     * @return 返回标准的排序语句,可以直接用于setOrderByClause（）方法
     * 可参考UserServiceImpl类。
     */
    public String getFormatString(){
        if(method == null || method.equals(""))
            return "null";
        else if(method.equals("ascending"))
            return field + " asc";
        else if(method.equals("descending"))
            return field + " desc";
        else
            return "null";
    }




    private String method;
    private String field;

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }


}
